package com.czy.seed.mvc.util;

public class NumberToCharArray {
    public char[] numberToChar(String num) {
        String ss = num;
        String s = null;
        String f_ss = "";
        if (ss.indexOf(".") > -1) {
            s = ss.substring(0, ss.indexOf("."));
            if (s.length() == 6) {

            } else if (s.length() == 5) {
                s = "0" + s;
            } else if (s.length() == 4) {
                s = "00" + s;
            } else if (s.length() == 3) {
                s = "000" + s;
            } else if (s.length() == 2) {
                s = "0000" + s;
            } else if (s.length() == 1) {
                s = "00000" + s;
            } else if (s.length() == 0) {
                s = "000000" + s;
            }
            String ls = ss.substring(ss.indexOf(".") + 1, ss.length());
            if (ls.length() > 2) {
                ls = ls.substring(0, 2);
            } else if (ls.length() == 2) {

            } else if (ls.length() == 1) {
                ls = ls + "0";
            } else {
                ls = "00";
            }
            f_ss = s + ls;
        } else {
            if (ss.length() == 6) {

            } else if (ss.length() == 5) {
                ss = "0" + ss;
            } else if (ss.length() == 4) {
                ss = "00" + ss;
            } else if (ss.length() == 3) {
                ss = "000" + ss;
            } else if (ss.length() == 2) {
                ss = "0000" + ss;
            } else if (ss.length() == 1) {
                ss = "00000" + ss;
            } else if (ss.length() == 0) {
                ss = "000000" + ss;
            }
            f_ss = ss + "00";
        }
        char[] arrays = f_ss.toCharArray();
        return arrays;
    }
}
